<template>
  <t-card :title="$t('pages.dashboardBase.tag.title')" :bordered="false">
    <div class="chart-container">
      <t-list stripe>
        <t-list-item v-for="(v, k) in data" :key="k">
          <t-row :gutter="10" align="center" style="flex: 1">
            <t-col :span="3">{{ v.tag }}</t-col>
            <t-col :span="7"><t-progress :color="{ from: '#36f', to: '#21CCFF' }" :percentage="v.range" /></t-col>
            <t-col :span="2">{{ v.count }}</t-col>
          </t-row>
        </t-list-item>
      </t-list>
    </div>
  </t-card>
</template>

<script lang="ts" setup>
import { PropType } from 'vue';

import { TagItem } from '../constants';

defineProps({
  data: {
    type: Array as PropType<TagItem[]>,
    default: () => [],
  },
});
</script>

<style lang="less" scoped>
.chart-container {
  height: 326px;
  :deep(.t-progress__info) {
    display: none;
  }
}
.t-card {
  :deep(.t-card__body) {
    padding-top: 0;
  }
}
</style>
